﻿using System.Collections.Generic;
using System.ServiceModel;
using RentalOfCars.Domain.Entities;
using RentalOfCars.Infrastructure.Entities;

namespace RentalOfCars.Server.Domain.ClientServerInterface
{
    [ServiceContract(SessionMode = SessionMode.Required)]
    [ServiceKnownType(typeof(Employee))]
    [ServiceKnownType(typeof(Client))]
    [ServiceKnownType(typeof(Discount))]
    [ServiceKnownType(typeof(EmployeeClass))]
    [ServiceKnownType(typeof(Discount))]
    public interface IDbAccessSession
    {
        [OperationContract(IsOneWay = false, IsInitiating = true, IsTerminating = false)]
        IEmployee Login(string login, string password);

        [OperationContract(IsOneWay = false, IsInitiating = false, IsTerminating = false)]
        IList<IClient> GetClients();

        [OperationContract(IsOneWay = false, IsInitiating = false, IsTerminating = false)]
        IList<IClient> GetRegularClients();

        [OperationContract(IsOneWay = false, IsInitiating = false, IsTerminating = false)]
        IList<IClient> GetBestClients();

        [OperationContract(IsOneWay = false, IsInitiating = false, IsTerminating = false)]
        IList<IClient> GetFineClients();

        [OperationContract(IsOneWay = false, IsInitiating = false, IsTerminating = false)]
        IClient AddClient(IClient client);

        [OperationContract(IsOneWay = false, IsInitiating = false, IsTerminating = false)]
        void DeleteClient(int clientId);

        [OperationContract(IsOneWay = false, IsInitiating = false, IsTerminating = false)]
        IList<IDiscount> GetDiscounts();

        [OperationContract(IsOneWay = false, IsInitiating = false, IsTerminating = true)]
        void Logoff();

        [OperationContract(IsOneWay = false, IsInitiating = false, IsTerminating = false)]
        IList<IEmployeeClass> GetEmployeeClasses();

        [OperationContract(IsOneWay = false, IsInitiating = false, IsTerminating = false)]
        IEmployee AddEmployee(IEmployee employee);

        [OperationContract(IsOneWay = false, IsInitiating = false, IsTerminating = false)]
        IList<IEmployee> GetEmployees();

        [OperationContract(IsOneWay = false, IsInitiating = false, IsTerminating = false)]
        void FireEmployee(IEmployee employee);

        [OperationContract(IsOneWay = false, IsInitiating = false, IsTerminating = false)]
        ICar AddCar(ICar car);

        [OperationContract(IsOneWay = false, IsInitiating = false, IsTerminating = false)]
        void DeleteCar(int carId);

        [OperationContract(IsOneWay = false, IsInitiating = false, IsTerminating = false)]
        IList<ICar> GetCars();

        [OperationContract(IsOneWay = false, IsInitiating = false, IsTerminating = false)]
        IList<IBrand> GetBrands();

        [OperationContract(IsOneWay = false, IsInitiating = false, IsTerminating = false)]
        IList<IFeature> GetFeatures();
    }
}